var btn = document.querySelector('button')
var usp=  document.querySelectorAll('input')
console.log(usp[0])



btn.addEventListener('click',function(){
	console.log(111+usp[0].value)
	//=================================================判断
	if( (usp[0].value=='root'&&usp[1].value=='1234567') ||(usp[0].value=='root1'&&usp[1].value=='1234567')){
		location.href='../../html/afterEnd/register1.html?'+usp[0].value
	}else{
		alert('用户名或密码错误')
		usp[0].value=''
		usp[1].value=''
	}
	
})
// 按钮样式
btn.addEventListener('mouseover',function(){
	
	var x = event.clientX-event.target.offsetLeft
	var y = event.clientY-event.target.offsetTop
	// var x = clientX-target.offsetLeft
	// var y = clientY-target.offsetTop
	console.log(x,y)
	let span = document.createElement('span')
	span.style.left= x+'px'
	span.style.top= y+'px'
	this.appendChild(span)
	setTimeout(function(){
		span.remove()
	},1000)
})
	